from flask_restx import Api
from flask import Blueprint

from .user.controller import api as user_ns

# Import controller APIs as namespaces.
api_bp = Blueprint("api", __name__)

authorizations = {
    'Bearer Token': {
        'description':'使用Swagger测试需要加前缀. Example: Bearer token',
        'type': 'apiKey',
        'in': 'header',
        'name': 'Authorization'
    },
}
api = Api(api_bp,version='1.0', security='Bearer Token', 
          authorizations=authorizations, title="API", 
          description="Main routes.")

# API namespaces
api.add_namespace(user_ns)